<%@ page language="java" import="java.util.*" pageEncoding="utf8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<script>
    function CheckForm() {

        alert('cleck');

        var ContactMan = document.getElementById("ContactMan");
        var Address = document.getElementById("Address");
        var ZipCode = document.getElementById("ZipCode");
        var Email = document.getElementById("Email");
        var Mobile = document.getElementById("Mobile");

        if (ContactMan.value == "") {
            alert('请输入收货人姓名!');
            ContactMan.focus();
            return false;
        } else if (Address.value == "") {
            alert('请输入收货人地址!');
            Address.focus();
            return false;
        } else if (ZipCode.value == "") {
            alert('请输入收货人邮编!');
            ZipCode.focus();
            return false;
        } else if (Email.value == "") {
            alert('请输入收货人邮箱!');
            Email.focus();
            return false;
        } else if (Mobile.value == "") {
            alert('请输入收货人邮箱!');
            Mobile.focus();
            return false;
        }

    }
</script>


<div class="DaoHang">您当前位置：<a href="Index">淘商城</a> &gt; 收银台</div>


<div class="cartbox">
    <c:if test="${niit_bc_cart != null }">
        <div class="logintips">亲爱的${niit_bc_user.userName }! 您的订单信息-> ：&nbsp;有图书<font
                color=green>${niit_bc_cart.bookNum }</font>&nbsp;件
        </div>
    </c:if>

    <div class="ShoppingCart">
        <form action="ShoppingCart.jsp?action=set" method="POST" name="check">
            <table border="0" cellspacing="1" cellpadding="1" align="center" width="100%" class="border">
                <tr class='title' height="25">
                    <td width="10%" align="center">编 号</td>
                    <td align="center">商 品 名 称</td>
                    <td width="15%" align="center">数 量</td>
                    <td width="15%" align="center">单价</td>
                    <td width="20%" align="center">总 计</td>
                </tr>
                <c:if test="${cartList == null }">
                    <tr class='tdbg'>
                        <td colspan=5>您的购物车没有商品!</td>
                    </tr>
                </c:if>
                <tr style="height:15px;">
                    <td colspan=8>&nbsp;</td>
                </tr>
                <c:if test="${cartList != null }">
                    <c:forEach items="${cartList }" var="bookList">

                        <tr class='tdbg' height="25" align="center">
                            <td><input type="CheckBox" name="cartid" value="2" Checked></td>
                            <td align="left" valign="top">
                                <a href="ShowBook?bookId=${bookList.bookId }" target="_blank"><img
                                        src="${bookList.bookPhoto }" alt="${bookList.bookName }" width="50" height="50"
                                        align="left" style="border:1px solid #ccc;padding:2px"/></a>
                                <a href="ShowBook?bookId=${bookList.bookId }"
                                   target="_blank">${bookList.bookName }</a><br/>
                            </td>
                            <td><input type="Text" name="Q_2" value="${bookList.bookCount }" size="5"
                                       style="text-align:center" class="textbox"></td>
                            <td>￥${bookList.bookPrice }</td>
                            <td>￥${bookList.bookAllPrice }</td>
                        </tr>


                    </c:forEach>
                </c:if>

                <tr class='tdbg'>
                    <td colspan="4" align="center">
                        <font color=red><strong>以上是订单中的商品信息，请核对,请勿刷新!</strong>&nbsp;</font>
                    </td>
                    <td height="25" align="center">合计：<font color="#FF6600">￥${cartAllPrice }</font>&nbsp;元</td>
                </tr>

            </table>
        </form>
    </div>
</div>

<div class="clear"></div>


<div class="contactborder">
    <FORM name="myform" onsubmit="retrun CheckForm(this);" action="Preview?orderId=${orderId }" method="post">
        <table cellSpacing=1 cellPadding=3 width="100%" align=center border=0>
            <tr>
                <td colSpan=2 class="titleinput">请填写收货信息</td>
            </tr>
            <tr>

                <td align=right width=100>收货人姓名：</td>
                <td><INPUT maxLength=50 name="ContactMan" id="ContactMan">*
                    <input type="hidden" name="${orderId }" id="${orderId }" value="${orderId }">
                </td>

            </tr>
            <tr>
                <td align=right width=100>收货人地址：</td>
                <td><INPUT maxLength=255 size=60 name="Address" id="Address">*</td>
            </tr>
            <tr class=tdbg>
                <td align=right width=100>收货人邮编：</td>
                <td height=20><INPUT maxLength=6 name="ZipCode" id="ZipCode">*</td>
            </tr>
            <tr class=tdbg>
                <td align=right width=100>收货人邮箱：</td>
                <td height=20><INPUT maxLength=100 size=30 name="Email" id="Email">*</td>
            </tr>
            <tr>
                <td align=right width=100>收货人手机：</td>
                <td><INPUT maxLength=50 size=30 name="Mobile" id="Mobile"></td>
            </tr>
            <tr>
                <td align=right>收货人QQ：</td>
                <td><INPUT maxLength=50 size=30 name="QQ" id="QQ"></td>
            </tr>
            <tr>
                <td align=right width=100>付款方式：</td>
                <td><select name='PaymentType'>
                    <option value='在线支付'>在线支付</option>
                    <option value='余额支付'>余额支付</option>
                    <option value='银行转帐'>银行转帐</option>
                    <option value='邮局汇款'>邮局汇款</option>
                    <option value='货到付款'>货到付款</option>
                    <option value='现金 '>现金</option>
                    <option value='支票'>支票</option>
                </select></td>
            </tr>
            <tr>
                <td align=right>送货方式：</td>
                <td>
                    <div class='delivery'>
                        <strong>快递公司：</strong>
                        <select onchange="ajshowdata($('#ccity').innerHTML)" name='DeliverType' id='DeliverType'>
                            <option value='EMS'>EMS</option>
                            <option value='圆通'>圆通</option>
                            <option value='天天快递'>天天快递</option>
                            <option value='上门取货'>上门取货</option>
                        </select>
                        <br/>
                    </div>
                </td>
            </tr>
            <tr>
                <td align=right width=100>备注/留言：</td>
                <td><TEXTAREA name=Remark cols=42></textarea></td>
            </tr>
            <tr>
                <td align=middle colSpan=2 height=50 style=" padding:5px; text-align:center">
                    <INPUT id=Action type=hidden value=Confirm name=Action>
                    <INPUT type="image" src="images/sure.gif" border="0" alt="确认订单" name=submit2 onclick="CheckForm();">
                </td>
            </tr>
        </table>
    </form>
</div>